package com.example.seckill.error;

import cn.hutool.core.util.StrUtil;

public class BussinessAssert {
    public static void state(boolean expression, CommonError commonError) throws IllegalStateException {
        if (!expression) {
            throw new BusinessException(commonError);
        }
    }

    public static void state(boolean expression, CommonError commonError,String errMsg) throws IllegalStateException {
        commonError=commonError.setErrMsg(errMsg);
        if (!expression) {
            throw new BusinessException(commonError);
        }
    }

}
